<?php
class AMS_Core_Controller_Abstract extends AMS_Object {
    protected $stage;
    protected $name;
    protected $action;
    protected $layout;
    
    public function setName($controllerName) {
        $this->name = $controllerName;
        return $this;
    }

    public function setAction($actionName) {
        $this->action = $actionName;
        return $this;
    }

    protected function setStage($stage='frontend') {
        $this->stage = $stage;
        return $this;
    }
    protected function initLayout() {
        $layoutFilename = AMS::getDesign()->getLayout($this->name.'.xml');
        $this->layout = AMS::getModel('core/layout')->setFilename($layoutFilename);
        return $this;
    }
    protected function loadLayout() {
        $this->layout->load();
        return $this;
    }
    protected function renderLayout() {
        $this->layout->render();
        return $this;
    }
}
?>
